package com.wyx.suanfa;

/**
 * @author 王艺锡
 * @version 1.0
 */
public class levelOrder2 {
    public static void main(String[] args) {

    }
}

/*
* class Solution {
    public List<List<Integer>> levelOrder(Node root) {
        List<List<Integer>> list = new ArrayList<>();
        Queue<Node> que = new LinkedList<>();

        if(root == null){
            return list;
        }

        que.offer(root);
        while(!que.isEmpty()){
            List<Integer> levelList = new ArrayList<>();
            int len = que.size();

            for(int i = 0;i<len;i++){
                Node temp = que.poll();
                levelList.add(temp.val);
                List<Node> children = temp.children;

                //如果当前节点有孩子节点
                if(!(children == null || children.size() == 0)){
                    for(Node child : children){
                        if(child != null){
                        que.offer(child);
                        }
                    }
                }

            }
            list.add(levelList);
        }
        return list;
    }
}*/
